package com.fay.designPattern.reflector;

import java.util.Objects;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/21 17:25
 * @Version 1.0
 */
public class Assert {
    public static void assertEquals(Integer expectedValue, Integer actualValue) {
        if (!Objects.equals(expectedValue, actualValue)) {
            String message = String.format("Test failed, expected:%d, actual:%d", expectedValue, actualValue);
            System.out.println(message);
        } else {
            System.out.println("Test succeeded.");
        }
    }

    public static boolean assertNull(Integer actualValue) {
        boolean isNull = actualValue == null;
        if (isNull) {
            System.out.println("Test succeeded.");
        } else {
            System.out.println("Test failed, the value is not null:" + actualValue);
        }
        return isNull;
    }
}
